package com.ghy.service;

import com.ghy.dto.CouponsInsertDTO;
import com.ghy.dto.CouponsPageDTO;
import com.ghy.dto.CouponsUpdateDTO;
import com.ghy.entity.Coupons;
import com.ghy.vo.CouponsSimpleListVO;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.ghy.entity.Coupons;

import java.util.List;

/**
 * 优惠卷表 服务层。
 *
 * @author ghy
 * @since 2024-12-22
 */
public interface CouponsService extends IService<Coupons> {

    boolean insert(CouponsInsertDTO dto);
    Coupons select(Long id);
    List<Coupons> top(Long n);
    List<CouponsSimpleListVO> simpleList();
    Page<Coupons> page(CouponsPageDTO dto);
    boolean update(CouponsUpdateDTO dto);
    boolean delete(Long id);
    boolean deleteBatch(List<Long> ids);
    /**
     * 根据兑换口令查询优惠卷
     *
     * @param code 兑换口令
     * @return 优惠卷
     */
    Coupons selectByCode(String code);

}
